package com.wayhome.srpingbootmybatis.mbs.expertimport.controller;

import com.wayhome.srpingbootmybatis.config.ApiResult;
import com.wayhome.srpingbootmybatis.mbs.expertimport.dto.SetlTldyInfoQueyDTO;
import com.wayhome.srpingbootmybatis.mbs.expertimport.service.DipTldyService;
import org.apache.http.HttpResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value="/web/tldyReqManager")
public class DipTldyContoller {

    @Autowired
    private DipTldyService dipTldyService;

    @PostMapping(value="/getDipTldyInfoList")
    public ApiResult getDipTldyInfoList(@RequestBody SetlTldyInfoQueyDTO setlTldyCodeCExample)throws Exception{
        return  dipTldyService.getDipTldyInfoList(setlTldyCodeCExample);
    }


    @PostMapping(value="/exportDipTldyInfo")
    public void exportDipTldyInfo(@RequestBody SetlTldyInfoQueyDTO setlTldyCodeCExample, HttpServletResponse response)throws Exception{
        dipTldyService.exportDipTldyInfo(setlTldyCodeCExample, response);
    }

    @PostMapping(value="/queryExportTldyInfo")
    public ApiResult queryExportTldyInfo(@RequestBody SetlTldyInfoQueyDTO setlTldyCodeCExample)throws Exception{
        return dipTldyService.queryExportTldyInfo(setlTldyCodeCExample);
    }

    @PostMapping(value="/queryExportTldyInfo2")
    public ApiResult queryExportTldyInfo2(@RequestBody SetlTldyInfoQueyDTO setlTldyCodeCExample)throws Exception{
        return dipTldyService.queryExportTldyInfo2(setlTldyCodeCExample);
    }

}
